package com.taxi.entity.json;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.taxi.util.DateTimeHelper;

import java.io.IOException;
import java.util.Date;

/**
 * @Author Dell
 * @Date 2021/6/11 16:46
 */
public class DateCustomerSerializer extends JsonSerializer<Date> {

    @Override
    public void serialize(Date value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
        gen.writeNumber(DateTimeHelper.dateToInt(value));
    }

}
